﻿using Common.Data.Repository;
using Customer.Core.Data.DataContextStorage;
using Customer.Model.Model;
using System.Data.Entity;

namespace Customer.Core.Data.Repository
{
    public class CustomerRepository : GenericRepository
    {
        public CustomerRepository()
            : base(DataContextFactory.GetDataContext())
        {
        }

        private static CustomerRepository _current = null;
        public static CustomerRepository Current
        {
            get
            {
                if (_current == null)
                {
                    _current = new CustomerRepository();
                }
                return _current;
            }
        }

        public DbSet<Customers> Customers
        {
            get
            {
                return ((CustomerEntities)this.DbContext).Customers;
            }
        }
        public DbSet<CustomerFeedback> CustomerFeedbacks
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerFeedbacks;
            }
        }
        public DbSet<CustomerFeedbackDetail> CustomerFeedbackDetails
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerFeedbackDetails;
            }
        }

        public DbSet<CustomerRegion> CustomerRegion1s
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerRegions;
            }
        }
        public DbSet<CustomerRelation> CustomerRelations
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerRelations;
            }
        }
        public DbSet<CustomerContact> CustomerContacts
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerContacts;
            }
        }
        public DbSet<CustomerPriority> CustomerPriorities
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerPriorities;
            }
        }

        public DbSet<Branch> Branchs
        {
            get
            {
                return ((CustomerEntities)this.DbContext).Branchs;
            }
        }
        public DbSet<ProductDeposit> ProductDeposits
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductDeposits;
            }
        }

        public DbSet<ProductLoan> ProductLoans
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductLoans;
            }
        }

        public DbSet<ProductCard> ProductCards
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductCards;
            }
        }
        public DbSet<ProductCardRawDaily> ProductCardRaws
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductCardRaws;
            }
        }

        public DbSet<ProductI2B> ProductI2Bs
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductI2Bs;
            }
        }
        public DbSet<ProductI2BDetail> ProductI2BDetails
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductI2BDetails;
            }
        }

        public DbSet<ProductPos> ProductPoss
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductPoss;
            }
        }

        public DbSet<ProductTrade> ProductTrades
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductTrades;
            }
        }
        public DbSet<ProductChuoi> ProductChuois
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ProductChuois;
            }
        }
        public DbSet<BadBank> BadBanks
        {
            get
            {
                return ((CustomerEntities)this.DbContext).BadBanks;
            }
        }
        public DbSet<AlertOverdue> AlertOverdues
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertOverdues;
            }
        }
        public DbSet<AlertGeneral> AlertGenerals
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertGenerals;
            }
        }
        public DbSet<AlertBadbankTopdown> AlertBadBanks
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertBadBanks;
            }
        }

        public DbSet<AlertBadbankBottomup> AlertBadbankBottomups
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertBadbankBottomups;
            }
        }
        public DbSet<AlertBadbankWatchlist> AlertBadbankWatchlists
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertBadbankWatchlists;
            }
        }

        public DbSet<LoanMatdt> LoanMatdts
        {
            get
            {
                return ((CustomerEntities)this.DbContext).LoanMatdts;
            }
        }
        public DbSet<AlertCasa> AlertCasas
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertCasas;
            }
        }
        public DbSet<AlertLC> AlertLCs
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertLCs;
            }
        }
        public DbSet<AlertBL> AlertBLs
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertBLs;
            }
        }

        public DbSet<AlertLimit> AlertLimits
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertLimits;
            }
        }
        public DbSet<AlertInactive> AlertInactives
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertInactives;
            }
        }
        public DbSet<NewLending> NewLendings
        {
            get
            {
                return ((CustomerEntities)this.DbContext).NewLendings;
            }
        }

        public DbSet<AccountPlanning> AccountPlannings
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlannings;
            }
        }
        public DbSet<AccountPlanningFinance> AccountPlanningFinances
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlanningFinances;
            }
        }

        public DbSet<AccountPlanningProductHolding> AccountPlanningProductHoldings
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlanningProductHoldings;
            }
        }

        public DbSet<AccountPlanningFinanceResult> AccountPlanningFinanceResults
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlanningFinanceResults;
            }
        }

        public DbSet<AccountPlanningProductHoldingResult> AccountPlanningProductHoldingResults
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlanningProductHoldingResults;
            }
        }
        public DbSet<AccountPlanningHistory> AccountPlanningHistorys
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AccountPlanningHistorys;
            }
        }
        public DbSet<TblAlertDepositMatdt> TblAlertDepositMatdts
        {
            get
            {
                return ((CustomerEntities)this.DbContext).TblAlertDepositMatdts;
            }
        }
        public DbSet<ProfitAbility> ToiAccumulateds
        {
            get
            {
                return ((CustomerEntities)this.DbContext).ToiAccumulateds;
            }
        }
        public DbSet<CustomerFinanceInfo> CustomerFinanceInfos
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerFinanceInfos;
            }
        }
        public DbSet<CustomerLimitInfo> CustomerLimitInfos
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerLimitInfos;
            }
        }
        public DbSet<CustomerFreedom> CustomerFreedoms
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerFreedoms;
            }
        }
        public DbSet<CustomerLowValue> CustomerLowValues
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerLowValues;
            }
        }
        public DbSet<AlertCardOverdue> AlertCardOverdues
        {
            get
            {
                return ((CustomerEntities)this.DbContext).AlertCardOverdues;
            }
        }
        public DbSet<CustomerNeedUpdateInfo> CustomerNeedUpdateInfos
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerNeedUpdateInfos;
            }
        }
        public DbSet<CustomerNeedUpdateInfoRaw> CustomerNeedUpdateInfoRaws
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerNeedUpdateInfoRaws;
            }
        }
        public DbSet<CustomerInfoDescription> CustomerInfoDescriptions
        {
            get
            {
                return ((CustomerEntities)this.DbContext).CustomerInfoDescriptions;
            }
        }
    }
}
